#pragma once
#include "Obstacle.h"

class Tool;
class Item;

class Resource : public Obstacle {
protected:
	IngredientType m_ingredientType;
	int m_bonusFlag; //IngredientType... -1 means none
	int m_numResources;
	int m_quality;
	int m_health;
	int m_currentHealth;
	std::list<Item*>* handleStrike();
public:
	Resource(ResourceType type, int numResources);
	Resource(std::ifstream& file);
	~Resource();
	void render(float x, float y);
	void logDetails(TextLog& log) const;
	bool isRightTool(const Tool& tool) const;
	int getRequiredQuality() const;
	int getNumResources() const;
	std::list<Item*>* gather(Tool* tool);
	bool destroy(int num);
	void save(std::ofstream& file) const;
};

inline int Resource::getRequiredQuality() const {return m_quality;}
inline int Resource::getNumResources() const {return m_numResources;}